package com.tohours.aia.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name = "aia_customer", schema = "dbo", catalog = "aiawebsite")
public class Customer implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String subCompany;
	private String slipNumber;
	private String beginDate;
	private String sellerName;
	private String sellerPhone;
	private String customerName;
	private String customerNumber;
	private String customerId;
	private String active;
	private Long totalChance;
	private Long leftChance;
	private Date birthday;
	private Set<GiftLog> giftLogs = new HashSet<GiftLog>();


	@Id
	@Column(name="id")
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid")
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	@Column(name="sub_company")
	public String getSubCompany() {
		return subCompany;
	}
	public void setSubCompany(String subCompany) {
		this.subCompany = subCompany;
	}

	@Column(name="slip_number")
	public String getSlipNumber() {
		return slipNumber;
	}
	public void setSlipNumber(String slipNumber) {
		this.slipNumber = slipNumber;
	}

	@Column(name="begin_date")
	public String getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(String beginDate) {
		this.beginDate = beginDate;
	}

	@Column(name="seller_name")
	public String getSellerName() {
		return sellerName;
	}
	public void setSellerName(String sellerName) {
		this.sellerName = sellerName;
	}

	@Column(name="seller_phone")
	public String getSellerPhone() {
		return sellerPhone;
	}
	public void setSellerPhone(String sellerPhone) {
		this.sellerPhone = sellerPhone;
	}

	@Column(name="customer_name")
	public String getCustomerName() {
		return customerName;
	}
	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	@Column(name="customer_number")
	public String getCustomerNumber() {
		return customerNumber;
	}
	public void setCustomerNumber(String customerNumber) {
		this.customerNumber = customerNumber;
	}

	@Column(name="customer_id")
	public String getCustomerId() {
		return customerId;
	}
	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	@Column(name="total_chance")
	public Long getTotalChance() {
		return totalChance;
	}
	public void setTotalChance(Long totalChance) {
		this.totalChance = totalChance;
	}

	@Column(name="left_chance")
	public Long getLeftChance() {
		return leftChance;
	}
	public void setLeftChance(Long leftChance) {
		this.leftChance = leftChance;
	}
	
	@Column(name="birthday")
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
	@OrderBy("insertTime")
	public Set<GiftLog> getGiftLogs() {
		return giftLogs;
	}
	public void setGiftLogs(Set<GiftLog> giftLogs) {
		this.giftLogs = giftLogs;
	}
	
	@Column(name="active")
	public String getActive() {
		return active;
	}
	public void setActive(String active) {
		this.active = active;
	}
	
}
